package com.platform.acl.controller;


import com.platform.acl.entity.Permission;
import com.platform.acl.service.PermissionService;
import com.platform.common_utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author CZF
 * @since 2022-02-28
 */
@Api(tags = "权限相关")
@RestController
@RequestMapping("/acl/permission")
@CrossOrigin
public class PermissionController {

    @Autowired
    PermissionService permissionService;

    @ApiOperation("获取所有用户权限")
    @GetMapping("/getAll")
    public R getAllPermission(){
        List<Permission> permissionList = permissionService.getAllPermission();

        return R.ok().data("permissionList",permissionList);
    }

}

